<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>用户详情</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="./css/frame/font.css">
		<link rel="stylesheet" href="./css/frame/xadmin.css">
		<link rel="stylesheet" href="./css/page/user.css" />
		<script type="text/javascript" src="./lib/jquery/jquery-3.3.1.min.js"></script>
		<script type="text/javascript" src="./lib/layui/layui.js"></script>
		<script type="text/javascript" src="./js/frame/xadmin.js"></script>
		<script type="text/javascript" src="./js/constant/urls.js"></script>
		<script type="text/javascript" src="./js/utils/TimeUtils.js"></script>
	</head>

	<body>
		<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
			<legend><b>用户信息详情</b></legend>
		</fieldset>
		<div class="main">
			<div class="content">
				<div id="headPictureLink"><b>头像：</b><img src="http://pic4.zhimg.com/50/v2-7f747e8387e670e2eac9d31b29a22de8_hd.jpg" alt="头像" height="200" width="200"/></div>
				<p class="mc-info" id="loginName"><b>登录名：</b></p>
				<p class="mc-info" id="mobilePhone"><b>手机号：</b></p>
				<p class="mc-info" id="username"><b>用户名：</b></p>
				<p class="mc-info" id="createTime"><b>创建时间：</b></p>
				<p class="mc-info" id="isLock"><b>当前状态：</b></p>
			</div>
			<div class="signature">
				<p class="mcf-info"><b>个性签名：</b></p>
				<div class="signature-count" id="signature"></div>
			</div>
		</div>
	</body>
	<script>
		$(function() {
			layui.use('layer', function() {
				var layer = layui.layer;

				let loc = location.href;
				let num = loc.indexOf("id=");
				let id = decodeURI(loc.substr(num + 3));
				let getUserInfoUrl = urls.sysUrl + "user/" + id;
				$.get(getUserInfoUrl, {}, function(res) {
					let data = res.data;
					if (res.errorCode === 0) {
						$('#loginName').append(data.loginName);
						let isLock = '';
						if(data.isLock){
							isLock = '禁用';
						}else {
							isLock = '正常';
						}
						$('#isLock').append(isLock);
						$('#mobilePhone').append(data.mobilePhone);
						$('#username').append(data.username);
						$('#createTime').append(timestampToDateTime(data.createTime));
						$('#signature').append(data.signature);
					} else {
						layer.open({
							type: 1,
							content: '<div style="padding: 20px 100px;">' + res.description + '</div>',
							btn: '关闭',
							btnAlign: 'c',
							shade: 0,
							yes: function() {
								layer.closeAll();
							}
						});
					}
				}, 'json');
			});
		});
	</script>
</html>
